<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class History_model extends CI_Model {

	function __construct() {
		parent::__construct();
	}

	/**
	 * 변경 이력 기록
	 * @param $user_id 변경자ID
	 * @param $target_id 대상ID
	 * @param $type 변경종류
	 * @param $detail 상세내용
	 * @param $reason 변경사유
	 */
	function insert_admin_history($user_id, $target_id, $type, $detail, $reason) {
		log_message('debug',"## History_model::insert_admin_history($user_id, $target_id, $type, $detail, $reason)");

		$this->db->set('user_id', $user_id);
		$this->db->set('target_id', $target_id);
		$this->db->set('type', $type);
		$this->db->set('detail', $detail);
		$this->db->set('reason', $reason);
		$this->db->set('create_dt', 'now()', FALSE);
		$this->db->insert('tb_admin_history') or $this->logsql->log_sql('error');
		
		$this->logsql->log_sql();
	}
}

/* End of file history_model.php */
/* Location: ./application/models/admin/history_model.php */